package com.trade.module.base.service.impl;

import com.trade.module.base.entity.LoginLog;
import com.trade.module.base.repository.LoginLogRepository;
import com.trade.module.base.service.LoginLogService;
import lombok.extern.log4j.Log4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.transaction.Transactional;

/**
 * Class Description: 登录日志服务层
 *
 * @Version v1.0 2017/4/22 15:24
 * @JDK version 1.8.0_51
 * @Author zfb
 */
@Log4j
@Service
@Transactional
public class LoginLogServiceImpl implements LoginLogService{

    /**
     * 注入登录日志数据服务层
     */
    @Autowired
    private LoginLogRepository loginLogRepository;

    /**
     * 保存登录日志
     *
     * @param loginLog 登录日志对象
     * @return loginLog 登录日志对象
     */
    @Override
    public LoginLog save(LoginLog loginLog) {
        if(null==loginLog){
            return null;
        }
        return loginLogRepository.save(loginLog);
    }
}
